﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class WebForm_ManageCodeMapping : System.Web.UI.Page
{
    protected void Page_Init(object sender, EventArgs e)
    {
        //((FormView)AddCodeMapping1.FindControl("fvParameter")).DataSource = (ObjectDataSource)SearchCodeMapping1.FindControl("ObjectDataSource1");
        
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        SearchCodeMapping1.Updating += new WebForm_ManageCodeMapping_SearchCodeMapping.UpdatingHandler(InitDataForUpdate);
        AddCodeMapping1.Updating += new WebForm_ManageCodeMapping_AddCodeMapping.UpdatingHandler(AddCodeMapping1_Updating);
        AddCodeMapping1.Inserting += new WebForm_ManageCodeMapping_AddCodeMapping.InsertHandler(AddCodeMapping1_Inserting);
        
    }

    void AddCodeMapping1_Inserting(object sender, EventArgs e)
    {
        TabContainer1.ActiveTab = SearchTabPanel;
        SearchCodeMapping1.BindGV();
    }

    void AddCodeMapping1_Updating(object sender, EventArgs e)
    {
        TabContainer1.ActiveTab = SearchTabPanel;
        SearchCodeMapping1.BindGV();
    }

    private void InitDataForUpdate(object sender, EventArgs e)
    {
        TabContainer1.ActiveTab = AddTabPanel;
        AddCodeMapping1.BindFV(this.SearchCodeMapping1.TableName, this.SearchCodeMapping1.ColumnName, this.SearchCodeMapping1.Value);
        
    }

    protected void lknAdd_Click(object sender, EventArgs e)
    {
        //AddCodeMapping1.ChangeFormViewMode();
        AddCodeMapping1.BindFVForInsert();
        TabContainer1.ActiveTab = AddTabPanel;
        
    }
}
